/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package scms;

import java.util.LinkedList;
import java.io.*;

/**
 * serializer helper class
 * @author pumped
 */
public class Export implements Serializable {

	private InventoryItem item;
	private int[][] parts;

	/**
	 * get item
	 * @return current item
	 */
	public InventoryItem getItem() {
		return item;
	}

	/**
	 * sets current inventory item
	 * @param item
	 */
	public void setItem(InventoryItem item) {
		this.item = item;
	}

	/**
	 * gets parts id array
	 * @return
	 */
	public int[][] getParts() {
		return parts;
	}

	/**
	 * set parts id array
	 * @param parts
	 */
	public void setParts(int[][] parts) {
		this.parts = parts;
	}

	/**
	 * constuctor
	 * @param i inventory item
	 * @param items parts array
	 */
	public Export(InventoryItem i, LinkedList<Part> items) {
		item = i;
		parts = new int[items.size()][2];
		int j = 0;
		for (Part part : items) {
			parts[j][0] = part.item.getID();
			parts[j][1] = part.amount;
			j++;
		}
	}

	/**
	 * default constructor
	 */
	public Export() {
	}
}
